import Vue from 'vue'
import VueRouter from 'vue-router'

const Home = () => import('views/home/Home')
const Category = () => import('views/category/Category')
const Chat = () => import('views/detail/childComps/chat')
const Car = () => import('views/car/Car')
const Profile = () => import('views/profile/Profile')
const Detail = () => import('views/detail/Detail')
const Login = () => import('views/profile/childComps/LoginOrRegister')
const Author = () => import('views/profile/childComps/Author')
const Complete = () => import('views/profile/childComps/CompleteInfo')
const OrderInfo = () => import('views/car/childComps/OrderInfo')
const Search = () => import('views/category/childComps/searchInfo')

Vue.use(VueRouter)

const routes = [
    {
        path: '',
        redirect: '/home'
    },
    {
        path: '/home',
        component: Home
    },
    {
        path: '/category',
        component: Category
    },
    {
        path: '/shopcar',
        component: Car
    },
    {
        path: '/profile',
        component: Profile
    },
    {
        path: '/detail/:id',
        component: Detail
    },
    {
        path: '/profile/login',
        component: Login
    },
    {
        path: '/profile/author',
        component: Author
    },
    {
        path: '/profile/complete',
        component: Complete
    },
    {
        path: '/shopcar/order',
        component: OrderInfo
    },
    {
        path: '/category/search',
        component: Search
    },
    {
        path: '/detail/:id/chat',
        component: Chat
    }
]

const router = new VueRouter({
    routes
})

export default router
